package br.com.utilitarios;

import java.io.File;

import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.HtmlEmail;

public class sendEmail {
	
	String nome;
	String email;
	String msg;
	
	 
	
	
	 public void enviarEmail(){
		 
		  HtmlEmail email = new HtmlEmail();
		 	File img = new File("WebContent/img/logo.png");
		 try {  
	        	
		       
		        email.setDebug(true);  
		        email.setHostName("smtp.gmail.com");  
		        email.setAuthentication("marcosvto1@gmail.com","4655798546557985");  
		        email.setSSL(true);  
		        email.addTo("marcosvinicius_26@hotmail.com"); //pode ser qualquer um email  
		        email.setFrom("marcosvto1@gmail.com"); //aqui necessita ser o email que voce fara a autenticacao  
		        email.setSubject("Teste");  
		       // email.setMsg("Mensagem Testando");  
		        //email.setHtmlMsg("");
		      /*  StringBuffer msg = new StringBuffer();
		        msg.append("<html><body>");
		        msg.append("<img src=cid:").append(email.embed(img)).append(">");	        
		        msg.append("</body></html>");*/        
		       
		        email.setHtmlMsg(msg);
		        //email.setHtmlMsg("</html>Seja Bem-vido ao <strong>Mercado Catalao</strong></html>");
		        
		       
		        
		        email.send();  
		  
		        } catch (EmailException e) {  
		  
		        System.out.println(e.getMessage());  
		  
		        }
		  

		 
		 
	 }

}
